using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace WebManager.Manager.User
{
    public partial class ListUser : System.Web.UI.Page
    {
        private LYQ.BLL.S_User sUserBll = new LYQ.BLL.S_User();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                GridView1.DataSource = sUserBll.GetList("").Tables[0];
                GridView1.DataBind();
            }

        }

        protected void New_Click(object sender, EventArgs e)
        {

            string url = URLUtility.UrlBase + "/WebManager/manager/user/NewUser.aspx";
            Page.Response.Redirect(url);
        }

        protected void Edit_Click(object sender, EventArgs e)
        {
            if (HttpContext.Current.Request.Form["selectCB"] == null) return;
            string[] sel = Request.Form["selectCB"].Split(',');

            string url = URLUtility.UrlBase + "/WebManager/manager/user/EditUser.aspx?UID=" + sel[0];
            Page.Response.Redirect(url);
        }

        protected void Delete_Click(object sender, EventArgs e)
        {
            if (HttpContext.Current.Request.Form["selectCB"] == null) return;
            string[] sel = Request.Form["selectCB"].Split(',');

            LYQ.BLL.S_User userBll = new LYQ.BLL.S_User();
            userBll.Delete(sel[0]);

            string url = URLUtility.UrlBase + "/WebManager/manager/user/ListUser.aspx";
            Page.Response.Redirect(url);
        }
    }
}
